# requested_topping = 'mushrooms'
requested_toppings = ['mushrooms', 'extra cheese']

'''
if requested_topping != 'anchoves':
    print('Hold the anchoves!')
'''
if 'mushrooms' in requested_toppings:
    print('Adding mushrooms.')
if 'pepperoni' in requested_toppings:
    print('Adding pepperoni.')
if 'extra cheese' in requested_toppings:
    print('Adding extra cheese.')
print("\nFinished making your pizza!")

a = []
if 'mushrooms' in requested_toppings:
    a.append('mushrooms')
if 'pepperoni' in requested_toppings:
    a.append('pepperoni')
if 'extra cheese' in requested_toppings:
    a.append('extra cheese')
print(a)
print('========================================')
for requested_topping in requested_toppings:
    if requested_topping == 'green peppers':
        print("Sorry we are out of green peppers.")
    else:
        print("Adding " + requested_topping + ".")
print("nFinished making your pizza.")

requested_toppings = []
if requested_toppings:
    for requested_topping in requested_toppings:
        print("Adding " + requested_topping + '.')
    print("\nFinished making your pizza.")
else:
    print("Are you sure you want a plain pizza.")

print('==================================')

availbale_toppings = ['mushrooms', 'vlives', 'green peppers', 'peperoni',
        'pineapple', 'extra cheese'] 
requested_toppings = ['mushrooms', 'french fries', 'extra cheese']
for requested_topping in requested_toppings:
    if requested_topping in availbale_toppings:
        print('Adding ' + requested_topping + '.')
    else:
        print("Sorry,we don't have " + requested_topping + '.')


# 以特殊方式给管理员打招呼；处理没有用户的情形
names = ['joy', 'jam', 'alis', 'admin', 'li']
if names:
    for name in names:
        if name == 'admin':
            print("Hello %s, would you like to see a status report?" % name)
    else:
        print("Hello %s, thank you for login in again." % name)
else:
    print("We need to find some users!")

# 检查用户名
current_users = ['xiaoli', 'xiaohong', 'xiaohua', 'xiaohuang', 'xiaobai']
new_users = ['xiaoili', 'xiaohuang', 'xiaowang', 'xiaojiang', 'xiaokuang']
for new_user in new_users:
    if new_user in current_users:
        print("用户名%s" % new_user + "已被注册，请输入其他用户名。")
    else:
        print("用户名%s" %  new_user + "未被注册，可以使用。")
